Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚧 stop_and_save_print_to_ram should not overwrite valid partial backup #4410

Closed
wants to merge 1 commit into from

Conversation

gudnimg
Copy link
Collaborator

@gudnimg gudnimg commented Sep 24, 2023

Thermal errors need to take a backup of the target temperatures before disabling the heaters. When the print is then later paused, stop_and_save_print_to_ram should use the partial backup if it is still valid (isPartialBackupAvailable=true). After stop_and_save_print_to_ram is done running and we have a 'full' backup, isPartialBackupAvailable is cleared in favor of saved_printing

Change in memory:
Flash: -156 bytes
SRAM: 0 bytes

@github-actions
Copy link

github-actions bot commented Sep 24, 2023

All values in bytes. Δ Delta to base

Target ΔFlash ΔSRAM Used Flash Used SRAM Free Flash Free SRAM
MK3S_MULTILANG -156 0 246932 5656 7020 2536
MK3_MULTILANG -156 0 246214 5663 7738 2529

@gudnimg gudnimg marked this pull request as ready for review October 1, 2023 12:06
@gudnimg gudnimg changed the title 🚧 stop_and_save_print_to_ram should not overwrite valid partial backup stop_and_save_print_to_ram should not overwrite valid partial backup Oct 1, 2023
@gudnimg gudnimg requested review from wavexx and 3d-gussner October 1, 2023 12:07
@gudnimg gudnimg added this to the FW 3.14.0 milestone Oct 1, 2023
@gudnimg gudnimg force-pushed the cleanup-stop-save-print branch from 9d37ea4 to ea3985f Compare October 15, 2023 13:39
@gudnimg
Copy link
Collaborator Author

gudnimg commented Oct 15, 2023

Rebased to sync with MK3 branch (105 commits)

@gudnimg gudnimg force-pushed the cleanup-stop-save-print branch from ea3985f to a53fd06 Compare November 3, 2023 17:31
@3d-gussner 3d-gussner self-assigned this Nov 17, 2023
Copy link
Collaborator

@3d-gussner 3d-gussner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me as the removed saved... values are refreshed using refresh_print_state_in_ram function.

@3d-gussner 3d-gussner removed their assignment Nov 23, 2023
memcpy(saved_pos, current_position, sizeof(saved_pos));
if (!isPartialBackupAvailable) {
refresh_print_state_in_ram();
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A problem I see here with this approach, is that now set_temp_error saves current_position before planner_abort_hard() is called, so current_position is not correct during a thermal error.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gudnimg Is this solved?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I havent had a good opportunity to look into this. I was too sick to do any productive things previous weekend

I will hopefully look at this again soon (and other PRs)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gudnimg is this solved?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No the PR needs to be reworked to address this. I think we should postpone this after 3.14

Thermal errors need to take a backup of the target temperatures.
When the print is then later paused, stop_and_save_print_to_ram
should not overwrite the partial backup if it is still valid.

Change in memory:
Flash: -150 bytes
SRAM: 0 bytes
@gudnimg gudnimg force-pushed the cleanup-stop-save-print branch from a53fd06 to 673f0f8 Compare December 9, 2023 10:54
@gudnimg
Copy link
Collaborator Author

gudnimg commented Dec 9, 2023

Synced PR with latest MK3 branch (~126 commits)

@gudnimg gudnimg marked this pull request as draft December 10, 2023 15:21
@gudnimg gudnimg changed the title stop_and_save_print_to_ram should not overwrite valid partial backup 🚧 stop_and_save_print_to_ram should not overwrite valid partial backup Dec 10, 2023
@3d-gussner 3d-gussner modified the milestones: FW 3.14.0, FW 3.14.1 Dec 11, 2023
@3d-gussner 3d-gussner self-requested a review April 4, 2024 07:24
@3d-gussner
Copy link
Collaborator

@gudnimg Is it still in progress or can that be reviewed?

@gudnimg
Copy link
Collaborator Author

gudnimg commented Apr 18, 2024

@gudnimg Is it still in progress or can that be reviewed?

@3d-gussner This pull request needs more work, the comment from @wavexx is still valid and I haven't looked more into this. Closing PR for now since I'm unlikely to finish it soon.

@gudnimg gudnimg closed this Apr 18, 2024
@3d-gussner 3d-gussner removed this from the FW 3.14.1 milestone Apr 18, 2024
@gudnimg gudnimg deleted the cleanup-stop-save-print branch September 1, 2024 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants